package dr.board.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dr.controller.*;
import dr.board.dao.BoardDAO;
import dr.board.domain.Board;

public class UpdateFormAction extends ActionSupportLogin {//글수정 폼

	@Override
	public String execute(HttpServletRequest request, 
			HttpServletResponse response) throws Throwable {

		String id=getUserLoginId(request);// session
		
		//login check
		if(id==null) return LOGINULL_PATH;
		//login check
		
		int num = Integer.parseInt(request.getParameter("num"));
        String pageNum = request.getParameter("pageNum");

        BoardDAO dbPro = BoardDAO.getInstance();
        Board article =  dbPro.updateGetArticle(num);

		//해당 뷰에서 사용할 속성
        request.setAttribute("pageNum", new Integer(pageNum));
        request.setAttribute("article", article);

		return "/board/updateForm.jsp"; //해당뷰
	}

}



